// src/test/java/com/.../bean/BenchmarkBean.java
package com.zijidelu.luframework.utils.lang.reflect.bean;

import lombok.Getter;
import lombok.Setter;

public class BenchmarkBean extends ParentBean {
    // --- 字段 ---

    // 场景1: 私有字段 + 公共 Lombok Getter/Setter
    @Getter
    @Setter
    private String name;
    @Getter
    @Setter
    private int age;
    @Getter
    @Setter
    private boolean active;

    // 场景2: 私有字段 (无getter/setter) -> 用于测试 MethodHandle 降级
    private String email;
    private long score;

    // 场景3: 公共字段 (无getter/setter) -> 用于测试 FieldAccess
    public String publicField;

    // 场景4: 其他访问权限
    protected int protectedField;
    @Getter
    @Setter
    private String lombokField; // <-- 核心：把丢失的 lombokField 加回来了！
    private String privateField;

    // 场景5: 特殊字段
    public static String staticField = "STATIC";
    public final String finalField = "FINAL";

    // --- 构造器 ---
    public BenchmarkBean() {
        this.name = "default";
    }

    public BenchmarkBean(String name) {
        this.name = name;
    }

    public BenchmarkBean(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private BenchmarkBean(Integer age) {
        this.age = age;
    }

    // --- 方法 ---
    public String publicMethod() {
        return "publicMethod";
    }

    protected int protectedMethod() {
        return 123;
    }

    private String privateMethod() {
        return "privateMethod";
    }

    public static String staticMethod() {
        return "staticMethod";
    }

    public final String finalMethod() {
        return "finalMethod";
    }

    // --- 重载方法 ---
    public String overloaded(String s) {
        return "String: " + s;
    }

    public int overloaded(int i) {
        return i;
    }

    // --- Getter/Setter for privateField ---
    public String getPrivateField() {
        return privateField;
    }

    public void setPrivateField(String privateField) {
        this.privateField = privateField;
    }

    // --- 包级别辅助方法 (仅供测试设置数据使用) ---
    void setEmail(String email) {
        this.email = email;
    }

    void setScore(long score) {
        this.score = score;
    }
}


